import { createApp } from 'vue'
import App from './App.vue'
import '../public/reset.css'
import '../public/mystyle.css'
import router from './router'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
import VMdPreviewHtml from '@kangc/v-md-editor/lib/preview-html';
import '@kangc/v-md-editor/lib/style/preview-html.css';
// import Prism from 'prismjs';
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import '@kangc/v-md-editor/lib/style/preview.css';
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';
// highlightjs
import hljs from 'highlight.js';

import { store,key } from './store/store'

// VueMarkdownEditor.use(vuepressTheme, {
//     Prism,
// });
VMdPreview.use(githubTheme, {
    Hljs: hljs,
    config: {
        toc: {
          includeLevel: [3, 4],
        },
      },
      toc: {
        includeLevel: [3, 4],
      },
});

const app = createApp(App);
app.use(router);
app.use(ElementPlus);
app.use(VueMarkdownEditor);
app.use(VMdPreviewHtml);
app.use(VMdPreview);
// 将 store 实例作为插件安装
app.use(store, key);
app.mount('#app');

// 注册Icons 全局组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}